<meta charset="utf-8">
<script type="text/javascript">
function nowDate() {
    var input = document.getElementById("time");
    var now = new Date();

    //获取年份、月份、日期
    var year = now.getFullYear();//返回年份
    var month = now.getMonth() + 1;//返回月份（0-11）
    var date = now.getDate();//返回一个月的某一天（1-31）

    //获取小时、分钟、秒钟
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();

    //输出自定义时间类型
    var timeStr = year + " / " + month + " / " + date + " " + hours + ":" + minutes + ":" + seconds;
    
    input.value = timeStr;

}
    // setInterval(nowDate,1000);
</script>

<?php
	echo "<script>setInterval(nowDate,1000);</script>";
?>